package org.mclll.xwangplugin.town.enums;

import org.mclll.xwangplugin.town.config.TownConfig;

/**
 * @author: geduo
 * @date: 2023/9/22 15:47
 */
public enum TownLevel {
    /**
     * 废墟
     */
    DUST("§7废墟"),
    /**
     * 一级
     */
    I("一级"),
    /**
     * 二级
     */
    II("§c二级"),
    /**
     * 三级
     */
    III("§e三级");

    public final String name;

    TownLevel(String name) {
        this.name = name;
    }


    public TownLevel lastLevel() {
        switch (this) {
            case I:
                return DUST;
            case II:
                return I;
            case III:
                return II;
            default:
                return this;
        }
    }

    public int totalTax() {
        switch (this) {
            case I:
                return TownConfig.LEVEL_I_TAX;
            case II:
                return TownConfig.LEVEL_II_TAX;
            case III:
                return TownConfig.LEVEL_III_TAX;
            default:
                return 0;
        }
    }
    public int playerSalary() {
        switch (this) {
            case I:
                return TownConfig.LEVEL_I_PLAYER_RECEIVE;
            case II:
                return TownConfig.LEVEL_II_PLAYER_RECEIVE;
            case III:
                return TownConfig.LEVEL_III_PLAYER_RECEIVE;
            default:
                return 0;
        }
    }

    public Double leaderReturnGift() {
        switch (this) {
            case I:
                return TownConfig.LEVEL_I_LEADER_RETURN_GIFT;
            case II:
                return TownConfig.LEVEL_II_LEADER_RETURN_GIFT;
            case III:
                return TownConfig.LEVEL_III_LEADER_RETURN_GIFT;
            default:
                return 0.0;
        }
    }


}
